<template>
  <div>
    <h1>count:{{ stores.count }}</h1>
    <h1>name:{{ stores.name }}</h1>
    <button @click="add">+1</button>
    <h2>计算属性：{{ stores.doubleCount }}</h2>
    <button @click="reset">重置</button>
  </div>
</template>

<script setup lang="ts">
// pinia状态存储
import { useCounterStore } from '@/stores/counter';

const stores = useCounterStore()
console.log(stores)
function add() {
  stores.increment()
}
function reset() {
  // 重置初始值
  stores.$reset()
}
</script>

<style scoped></style>